<template>
	<view>
		<!-- Grid 宫格 -->
		<van-grid>
		  <van-grid-item use-slot v-for="(item,index) in navigate" :key="index" @click="go(item)">
		    <image
		      style="width: 100%; height: 90px;"
		      :src="item.image_src"
		    />
		  </van-grid-item>
		</van-grid>
	</view>
</template>

<script>
	export default {
		name:"navigate",
		data() {
			return {
				navigate:[]
			};
		},
		created() {
			this.getNav()
		},
		methods:{
			// 请求数据
			async getNav(){
				let {data:res} = await uni.$http.get('/api/public/v1/home/catitems')
				console.log(res,'navigate')
				this.navigate = res.message
			},
			//点击跳转
			go(item){
				if(item.name === '分类'){
					uni.switchTab({
						url:'/pages/cate/cate'
					})
				}
			}
		}
	}
</script>

<style lang="scss">

</style>
